package com.htiiot.status.monitor;

import com.htiiot.status.write.WriterCache;
import org.apache.logging.log4j.LogManager;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Monitor{
	private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(Monitor.class);

	//@Scheduled(cron = "*/5 * * * * ?") //每5秒执行
	@Scheduled(cron = "0 0 0 * * ?")  //每天凌晨执行
	public void schedule() {
		logger.info( "spring boot scheduled started" );
		WriterCache.updateWriter();
	}
}
